#   Name: CMakeLists.txt
#   Createed by: Le Manh Thang
#   Date: 10/03/2020
#   


cmake_minimum_required (VERSION 3.0)

enable_language(C)
enable_language(CXX)

project (darknet2ncnn)

set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED True)

#add share libray opencv
#set( OpenCV_DIR libopencv_world.so)
#link_directories(/media/thanglmb/DATA/myProject/AI_DL/libOpenCV/lib)
#include_directories(/media/thanglmb/DATA/myProject/AI_DL/libOpenCV/include/opencv4)

# add opencv /usr/local/lib
find_package ( OpenCV REQUIRED)
include_directories( ${OpenCV_INCLUDE_DIRS})


# call lib darknet
set (DARKNET_LIB libdarknet.a)
link_directories( /media/thanglmb/DATA/myProject/AI_DL/darknet2ncnn/cameraDemo/darknet/build)
include_directories(/media/thanglmb/DATA/myProject/AI_DL/darknet2ncnn/cameraDemo/darknet/include)

#call lib ncnn
set (NCNN_LIB libncnn.a)
link_directories( /media/thanglmb/DATA/myProject/AI_DL/darknet2ncnn/cameraDemo/libncnn/lib)
include_directories(/media/thanglmb/DATA/myProject/AI_DL/darknet2ncnn/cameraDemo/libncnn/include/ncnn)


file(GLOB SOURCES src/*.cpp src/layer/*.cpp)
include_directories(${CMAKE_SOURCE_DIR}/include)
#include_directories(${CMAKE_SOURCE_DIR}/src/layer)
include_directories(${CMAKE_SOURCE_DIR}/src)
add_library(${PROJECT_NAME} ${SOURCES})
target_link_libraries( ${PROJECT_NAME} ${OpenCV_LIBS} ${DARKNET_LIB} ${NCNN_LIB} -Ofast -Wall -lm -lpthread -lstdc++ -Wno-unused-result  -Wfatal-errors -fPIC)
target_include_directories(${PROJECT_NAME}  PUBLIC ${CMAKE_SOURCE_DIR}/include  )

target_compile_features(${PROJECT_NAME}  PUBLIC cxx_std_11)



